#include<iostream>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>

void* threadFunc(void* arg) {
    for (int i = 0; i <64*1024*1024; i+=1024){
        char* addr = (char*) malloc(1024);
    }
}

// MALLOC_ARENA_MAX=4   ./per_thread_arena
int main() {
    for (int i = 0; i < 10; i++) {
        pthread_t ntid;
        int ret = pthread_create(&ntid, NULL, threadFunc, NULL);
    }
    sleep(10);
    printf("Wake up\n");
    return 0;
}